package cn.zero.feign;

import cn.zero.domain.AjaxResult;
import cn.zero.domain.Store;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class StoreFeignClientFallbackFactory implements FallbackFactory<StoreFeignClient> {
    @Override
    public StoreFeignClient create(Throwable throwable) {

        return new StoreFeignClient() {
            @Override
            public AjaxResult add(Store store) {
                throwable.printStackTrace();
                return new AjaxResult(false,"服务器异常！！！！");
            }
        };
    }
}
